package listbyorder.access101_200.test189;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/15 11:50
 */
public class Solution1 {

    public void rotate(int[] nums, int k) {
        int len = nums.length;
        int[] temp = new int[len];
        for (int i = 0; i < len; i++) {
            temp[i] = nums[i];
        }
        int c = len - (k % len);
        for (int i = 0; i < len; i++) {
            nums[i] = temp[(c % len)];
            c++;
        }
    }
}
